const mdb='mongodb://srp:srp@119.23.182.180:27017/mydb?authSource=mydb&readPreference=primary&appname=MongoDB%20Compass&ssl=false';
const { MongoClient }=require('mongodb');

const article={
    title:'ttt',
    num:'cli'
}
MongoClient.connect(mdb).then((db)=>{
    console.log('absolutely used');
/*    db.collection('mycol').insertOne(article).then((res)=>{
        console.log(res.insertedId);
        console.log(article._id);
    })*/

/*    db.collection('mycol').find({
        title:'ttt'
    }).toArray().then(resu=>{
        console.log(resu);
    })*/

    db.collection('mycol').find({
        title: 'ttt'
    }).toArray().then(re=>{
        console.log(re);
    })


    // db.close();
},console.error);